package com.chittoda.koncurrent.scheduling;

import java.util.Random;

public class RandomScheduling extends AbstractSchedule {

	private final Random random = new Random();
	
	public RandomScheduling(int size) {
		super(size);
	}
	
	@Override
	public int getNextIndex() {
		int index;
		synchronized (random) {
			index = random.nextInt(size);
		}
		return index;
	}

	
}
